package com.uni.controller.admin;

import com.uni.base.RestResponse;
import com.uni.pojo.Prodtype;
import com.uni.service.ProdtypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @作者: Unirithe
 * @日期: 2022/2/23
 **/
@RestController
@RequestMapping("/admin/prodtype")
public class ProdtypeAdminController {

    @Autowired
    private ProdtypeService prodtypeService;

    @PostMapping("/queryall")
    public String toQueryAll(){
        List<Prodtype> prodtypes = prodtypeService.getAll();
        return RestResponse.ok(prodtypes).toJSONString();
    }
}
